	<extend name="Public:template" />
<block name="page_header">
	<include file="Public:header_cust"/>
</block>
<block name="page_body">
	<div class="row">
		<div class="span4">
			<include file="Public:left_menu_cust"/>
		</div>
		<div class="span16">
			<include file="Public:breadcrumb_cust"/>
		</div>
		<div class="span8">
			<table class="table table-bordered">
				<tr>
					<th class="alert-warning text-left" style="font-size:14px"><img class="img-thumbnail" src="__ROOT__/statics/mobile/images/icons/change_password.png"><span>&nbsp;修改密码</span></th>
				</tr>
				<tr>
					<td>
					<div id="alert_box">
						<div class="alert alert-success" style="display:none"></div>
						<div class="alert alert-danger" style="display:none"></div>
					</div>
					<form action="{:U('CustPassport/doChgpwd')}" method="post" id="form_edit" name="form_edit" role="form">
						<div class="input-prepend">
							<span class="btn ">旧密码</span>
							<input type="password" class="input-large"  id="cust_pass" name="cust_pass" placeholder="请输入 旧密码">
						</div>
						<div class="input-prepend">
							<span class="btn ">新密码</span>
							<input type="password" class="input-large"  id="cust_pass_new" name="cust_pass_new" placeholder="请输入 新密码">
						</div>
					</form>
					</td>
				</tr>
				<tr>
					<td>
						<button type="button" id="doChgpwdBtn" class="btn btn-warning active mt15"><span class="icon-white icon-pencil"></span>提交修改</button>
					</td>
				</tr>
			</table>
		</div>
		<div class="span8">
			<div class="alert alert-success">
				安全提醒：密码至少6位，请勿将密码透漏给他人，养成良好的网络安全意识
			</div>
		</div>
	</div>
</block>
<block name="script_footer">
<script type="text/javascript">
$(document).ready(function(){
	$("#doChgpwdBtn").on( "click", function() {
		$("#alert_box .alert-danger").hide();
		$("#alert_box .alert-success").hide();
		$.ajax({
	        'url': $("#form_edit").attr("action"),
	        'type':"post",
	        'dataType': "json",
	        'data': $('#form_edit').serialize(),
	        'success': function (data) {
	        	var error = data['error'];
	        	var message = data['message'];
	        	if(error=='0'){
	        		$("#alert_box .alert-success").html(message).show;
	        		alert(message);
	        		document.location.href="/Cust/index.html"; 
	        	}else{
	        		$("#alert_box .alert-danger").html(message).show();
	        	}
	        }
	    });
	});
})
</script>
</block>